<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>大风车</title>
		<script src="../js/jquery-1.11.1.js"></script>
		<style>
			.imga{
				animation: dfc .8s linear infinite;
			}
			/* 关键帧 */
			@keyframes dfc{
				0%{
					transform: translate(20px) rotate(180deg) scale(1);
				}
				30%{
					transform: translate(240px) rotate(360deg) scale(1.1);
				}
				100%{
					transform: translate(1100px) rotate(720deg) scale(1.2);
				}
			}
			
			.imgb{
				animation: dfc1 .8s linear infinite;
			}
			/* 关键帧 */
			@keyframes dfc1{
				0%{
					transform: translate(20px) rotate(180deg) scale(1);
				}
				30%{
					transform: translate(240px) rotate(360deg) scale(1.1);
				}
				100%{
					transform: translate(1100px) rotate(720deg) scale(1.2);
				}
			}
		</style>
	</head>
	<body>
		<img src="../img/1.gif" alt="1" width="300px" height="300px" />
		<audio src="../dafengche.mp3" autoplay></audio>
		<button id="btn1">开转</button>
		<button id="btn2">暂停</button>
		<button id="btn3">翻转</button>
		
		<script>
			//1.点击 开转 图片切换并且添加样式 .imga
			$("#btn1").click(function(){
				$("img").attr("src","../dfc.jpg").addClass("imga");
			});
			//2.暂停：音乐停+动画效果无
			$("#btn2").click(function(){
				$("audio").removeAttr("src");
				$("img").removeClass("imga");
			});
			//3.   ！！！翻转：切换：imga切换imgb
			$("#btn3").click(function(){
				$("img").toggleClass("imgb");
				$("audio").attr("src","../dafengche.mp3");
			});
		</script>
	</body>
</html>